package step_two;

public class xuanZe {
    public static void main(String[] args) {
//        选择排序
        int query[] = {1, 5, 6, 2, 0, 14, 52, 32, 98};

        test(query);

        for (int i = 0; i < query.length; i++) {
            System.out.print(query[i] + " ");
        }
    }

    public static void test(int[] query) {
        for (int i = 0; i < query.length-1; i++) {
            int max = query[i],p = i;
            for (int j = i+1; j < query.length; j++) {
                if (query[j] > max){
                    max = query[j];
                    p=j;
                }
            }
            int temp=query[p];
            query[p]=query[i];
            query[i]=temp;



        }


    }
}
